{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}
<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##User search##</span></h2>
</div>
<div class="ag_outerwrap">
	<form id="ag_userlist" method="get" action="{$self_url}">
		<input type="hidden" name="option" value="com_agora" />
		<input type="hidden" name="task" value="userlist" />
		<input type="hidden" name="action" value="search" />
		<fieldset class="ag_inform">
			<legend class="ag_color">##User find legend##</legend>
			<table width="100%" border="0" cellpadding="0" cellspacing="0" class="ag_search">
				<tr>
					<td width="150px" class="ag_color">
						<label for="username">##Username##</label>
					</td>
					<td class="ag_color">
						<input class="ag_text_area2" type="text" id="username" name="form[username]" value="{$form.username|escape}" size="50" maxlength="25" style="width:70%;" />
					</td>
				</tr>
				<tr>
					<td width="150px" class="ag_color">
						<label for="show_group">##User group##</label>
					</td>
					<td class="ag_color">
						<select id="show_group" name="form[show_group]">
							<option value="-1" {if $form.show_group == -1}selected="selected"{/if}>##All users##</option>
							{foreach from=$groups item=group}
							{strip}
							<option value="{$group.id}" {if $form.show_group == $group.id}selected="selected"{/if}>
								{section name=level_loop loop=$group.level}&nbsp;
								{/section}
								{$group.name}
							</option>
							{/strip}
							{/foreach}
						</select>
					</td>
				</tr>
				<tr>
					<td width="150px" class="ag_color">
						<label for="sort_by">##Sort by##</label>
					</td>
					<td class="ag_color">
						<select id="sort_by" name="form[sort_by]">
							<option value="username" {if $form.sort_by == 'username'}selected="selected"{/if} >##Username##</option>
							<option value="registered" {if $form.sort_by == 'registered'}selected="selected"{/if} >##Registered##</option>
						</select>
					</td>
				</tr>
				<tr>
					<td width="150px" class="ag_color">
						<label for="sort_dir">##Sort order##</label>
					</td>
					<td class="ag_color">
						<select id="sort_dir" name="form[sort_dir]">
							<option value="ASC" {if $form.sort_dir == 'asc'}selected="selected"{/if} >##Ascending##</option>
							<option value="DESC" {if $form.sort_dir == 'desc'}selected="selected"{/if} >##Descending##</option>
						</select>
					</td>
				</tr>
			</table>
			<div class="ag_hint">##User search info##</div>
		</fieldset>
		<div class="ag_postbuttons">
			<span>
				<input class="ag_button ag_btn_submit" type="submit" name="search" value="##Submit##" title="##Submit##" accesskey="s" />
			</span>
		</div>
	</form>
</div>

<div class="ag_postlinksTop">
	<div class="ag_pagelink">
		{include file=agora:include/paginate.tpl}
	</div>
</div>
<div class="ag_rightend">
	<h2 class="ag_headerbar"><span class="ag_middle">##User list##</span></h2>
</div>
<div class="ag_tablewrap">
	<table width="100%" border="0" cellpadding="0" cellspacing="0">
		<thead>
			<tr>
				<th class="ag_userlist" scope="col">##Avatar##</th>
				<th class="ag_userlist" scope="col">##Username##</th>
				<th class="ag_userlist" scope="col">##Stats##</th>
				<th class="ag_userlist" scope="col">##Registered##</th>
			</tr>
		</thead>
		<tbody>
			{foreach from=$users item=user}
			<tr class="{$rowbg}">
				<td class="ag_userlist ag_userlistAvatar">
					<img src="{$user.avatar}" alt="##Avatar##" />
				</td>
				<td class="ag_userlist">
				{if $user.username}
					<div class="ag_userName">
						<a href="{url task=profile user_id=$user.id}" title="{if $agora_config.o_fullnames_enabled}{$user.name|nomail}{else}{$user.username|nomail}{/if}">{if $agora_config.o_fullnames_enabled}{$user.name|nomail}{else}{$user.username|nomail}{/if}</a>
					</div>
					{if $user.title}
					<div class="ag_userTitle">
						<span class="ag_userTitle"><strong>##Title##:</strong> {$user.title}</span>
					</div>
					{/if}
				{else}
					<div class="ag_userName_DeletedMember">
					##Deleted Member##
					</div>
				{/if}
				</td>
				<td class="ag_userlist ag_userlistStats">
					{if $agora_config.o_show_post_count or !$agora_user.is_guest}
					<p class="ag_user_numPosts">
						<strong>{$user.num_posts}</strong> ##Posts##
					</p>
					{/if}

					{if $user.last_post}
					<p class="ag_user_lastPost">
						<strong>##Latest posts##:</strong><br />
						{$user.last_post|agora_date}
					</p>
					{/if}

					{if $user.last_visit}
					<p class="ag_user_lastVisit">
						<strong>##Last visit##:</strong><br />
						{$user.last_visit|agora_date}
					</p>
					{/if}

					{if $user.rank_image}
					<p class="ag_user_rank">
						<img src="{$root_url}img/ranks/{$user.rank_image}" alt="{$user.rank}" title="{$user.rank}" />
					</p>
					{/if}
				</td>
				<td class="ag_userlist ag_userlist_Registered">
					<span>{$user.registered|agora_date}</span>
				</td>
			</tr>
			{foreachelse}
			<tr>
			{if $agora_config.o_show_post_count or !$agora_user.is_guest}
				<td class="ag_spacer ag_userlist_empty" colspan="4">##No hits##</td>
			{else}
				<td class="ag_spacer ag_userlist_empty" colspan="4">##No hits##</td>
			{/if}
			</tr>
			{/foreach}
		</tbody>
	</table>
</div>
<div class="ag_postlinksBottom">
	<div class="ag_pagelink">
		{include file=agora:include/paginate.tpl}
	</div>
</div>
<div class="ag_forum_separator"></div>